local internet = require("internet")
local component = require("component")
local fs = require("filesystem")
local shell = require("shell")

local args = shell.parse(...)

local url,filename = args[1],args[2]

local function gitee_get(url,path)
	
    local _, response = pcall(internet.request, url, nil, { ["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" })
    for chunk in response do
	f:write(chunk)
	end
	f:close()
end

gitee_get(url,filename)